


const { createStore } = require('redux');

// 引入reducer
const reducer = require('./reducer');

/* const {CHANGENAME,CHANGECOUNT}  =require('./actionTypes.js')

// 初始数据
const initialState = {
  name: "leo",
  count: 100
}

// reducer 函数
function counterReducer(state = initialState, action) {
  switch (action.type) {
    case CHANGENAME:
      return { ...state, name: action.name }
    case CHANGECOUNT:
      return { ...state, count: action.count }
    default:
      return state;
  }
  // return state;
} */




// 创建store
// const store = createStore(counterReducer);
const store = createStore(reducer);

module.exports = store